<layout name='Layout/layout_main' />
<div class="title panel panel-default">
	<div class="panel-body">
		<h3 class="col-md-12">编辑帖子</h3>
	</div>
</div>
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   class="well form-horizontal">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="id" name="id" value="{$vo.id}">
	<input type="hidden" id="add_file" name="add_file" value="{$vo.add_file}">
	<input type="hidden" id="opmode" name="opmode" value="edit">

	<div class="form-group">
		<label class="col-md-2 control-label" for="name">主题*：</label>
		<div class="col-md-10">
			<input value="{$vo.name}" class="form-control" type="text" id="name" name="name" check="require" msg="请输入主题">
		</div>
	</div>

	<div class="form-group">
		<label class="col-md-2 control-label">附件：</label>
		<div class="col-md-10">
			<include file="Layout:uploader" />
		</div>
	</div>

	<div class="form-group">
		<div class="col-md-12">
			<textarea id="content" name="content" style="width:100%;height:300px;" check="require" msg="请输入内容">{$vo.content}</textarea>
		</div>
	</div>

	<div class="action">
		<input class="btn btn-default" type="button" value="保存" onclick="save();">
		<input  class="btn btn-default" type="button" value="取消" onclick="go_return_url();">
	</div>
</form>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.js"></script>
<script type="text/javascript" src="__PUBLIC__/editor/kindeditor.setting.js"></script>
<script type="text/javascript">
	function save() {
		editor.sync();
		if (check_form("form_data")) {
			sendForm("form_data", "{:U('save')}");
		}
	}


	$(document).ready(function() {
		editor_init();

	}); 
</script>